package com.akupilih.app;


import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

@SuppressLint("ValidFragment")
public class WelcomeFragment extends Fragment {
	private String slide_title = null;
	private String slide_text = null;
	private Drawable icon = null;
	private int position = 0;

	public WelcomeFragment(String slide_title, String slide_text, Drawable icon, int position){
		this.slide_title = slide_title;
		this.slide_text = slide_text;
		this.icon = icon;
		this.position = position;
	}
	
	public WelcomeFragment(){
		
	}
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    	ViewGroup rootView = null;
    	if(position==0){
    		rootView = (ViewGroup) inflater.inflate(R.layout.fragment_welcome, container, false);
    	}else{
	    	rootView = (ViewGroup) inflater.inflate(R.layout.fragment_feature, container, false);
	            
	        TextView slide_title_textview = (TextView) rootView.findViewById(R.id.fragment_welcome_slide_title);
	        slide_title_textview.setText(slide_title);
	        
	        TextView slide_text_textview = (TextView) rootView.findViewById(R.id.fragment_welcome_slide_info);
	        slide_text_textview.setText(slide_text);
	        
	        ImageView icon_imageview = (ImageView) rootView.findViewById(R.id.fragment_welcome_slide_icon);
	        icon_imageview.setImageDrawable(icon);
    	}
    	return rootView;
    }
    
}
